package com.prp.gwt.client.vo;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

public class MailBoxList implements IsSerializable{
	
	private List<MailboxInfo> mailboxs = new ArrayList<MailboxInfo>();
	
	public void copy(MailBoxList list){
		mailboxs.clear();
		mailboxs.addAll(list.mailboxs);
	}
	public int size(){
		return mailboxs.size();
	}
	
	public MailboxInfo get(int index){
		return mailboxs.get(index);
	}
	
	public void addMail(MailboxInfo mailbox){
		mailboxs.add(mailbox);
	}
	
	public void deleteMailbox(MailboxInfo mailboxInfo){
		for( int i = 0; i < mailboxs.size(); i++){
			if( mailboxInfo.getId() == mailboxs.get(i).getId()){
				mailboxs.remove(i);
				break;
			}
		}
	}

}
